home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sunrpc / Makefile < prev    next >
Encoding:
Makefile  |  1994-07-18  |  4.7 KB  |  129 lines

  1. # Copyright (C) 1994 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3.  
  4. # The GNU C Library is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU Library General Public License as
  6. # published by the Free Software Foundation; either version 2 of the
  7. # License, or (at your option) any later version.
  8.  
  9. # The GNU C Library is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. # Library General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU Library General Public
  15. # License along with the GNU C Library; see the file COPYING.LIB.  If
  16. # not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. # Cambridge, MA 02139, USA.
  18.  
  19. #
  20. #    Sub-makefile for sunrpc portion of the library.
  21. #
  22. subdir    := sunrpc
  23.  
  24. # The code in this subdirectory is taken verbatim from Sun's RPCSRC-4.0
  25. # distribution.  A few files needed trivial modifications to compile in the
  26. # GNU environment; these changes are marked by comments that say
  27. # `roland@gnu'.  All the code from Sun's rpc, etc, and rpcgen
  28. # subdirectories is in this directory; the rpc subdirectory contains only
  29. # the header files.  Other than that, several files were renamed so as not
  30. # to exceed 14-character file name limits:
  31. #
  32. #    authunix_prot.c -> authuxprot.c
  33. #    bindresvport.c -> bindrsvprt.c
  34. #    clnt_generic.c -> clnt_gen.c
  35. #    clnt_perror.c -> clnt_perr.c
  36. #    clnt_simple.c -> clnt_simp.c
  37. #    get_myaddress.c -> get_myaddr.c
  38. #    pmap_getmaps.c -> pm_getmaps.c
  39. #    pmap_getport.c -> pm_getport.c
  40. #    rpc_callmsg.c -> rpc_cmsg.c
  41. #    rpc_commondata.c -> rpc_common.c
  42. #    rpc_dtablesize.c -> rpc_dtable.c
  43. #    svc_auth_unix.c -> svc_authux.c
  44. #    xdr_reference.c -> xdr_ref.c
  45. #    rpcsvc/bootparam_prot.x -> rpcsvc/bootparam.x
  46.  
  47. headers = $(addprefix rpc/,auth.h auth_unix.h clnt.h netdb.h pmap_clnt.h \
  48.                pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h svc.h \
  49.                svc_auth.h types.h xdr.h) \
  50.       $(rpcsvc:%=rpcsvc/%) $(rpcsvc:%.x=rpcsvc/%.h)
  51. rpcsvc = bootparam.x nlm_prot.x rstat.x \
  52.      yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
  53.      rnusers.x spray.x nfs_prot.x rquota.x yp.x
  54. install-others = $(includedir)/rpcsvc/bootparam_prot.h \
  55.          $(sysconfdir)/rpc
  56. generated = $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c)
  57.  
  58. routines := auth_none auth_unix authuxprot bindrsvprt \
  59.         clnt_gen clnt_perr clnt_raw clnt_simp clnt_tcp \
  60.         clnt_udp rpc_dtable get_myaddr getrpcent getrpcport \
  61.         pmap_clnt pm_getmaps pm_getport pmap_prot \
  62.         pmap_prot2 pmap_rmt rpc_prot rpc_common rpc_cmsg \
  63.         svc svc_auth svc_authux svc_raw svc_run svc_simple \
  64.         svc_tcp svc_udp xdr xdr_array xdr_float xdr_mem \
  65.         xdr_rec xdr_ref xdr_stdio
  66.  
  67. install-lib := librpcsvc.a
  68. install-bin := rpcgen
  69. install-sbin := rpcinfo portmap
  70. rpcsvc-objs = $(rpcsvc:%.x=x%.o)
  71. rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
  72.           rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o
  73. extra-objs = $(rpcgen-objs) $(rpcsvc-objs)
  74. omit-deps = $(basename $(rpcsvc-objs))
  75. # These headers are part of rpcgen.
  76. distribute := rpc_util.h rpc_parse.h rpc_scan.h $(rpcgen-objs:.o=.c) etc.rpc
  77.  
  78. others := portmap rpcinfo
  79.  
  80. # Sun's code is not too clean.
  81. override +gccwarn := -w
  82.  
  83. include ../Rules
  84.  
  85. $(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(libc.a)
  86.     $(+link)
  87.  
  88. rpcgen-cmd = $(dir $(word 2,$^))$(notdir $(word 2,$^))
  89.  
  90. # The proper file name is longer than 14 chars, so we install it under
  91. # a shorter name.  But if the filesystem can handle it, we want to
  92. # install under the proper name as well.
  93. $(includedir)/rpcsvc/bootparam_prot.h: $(includedir)/rpcsvc/bootparam.h
  94.     @echo It is safe to ignore an error here if this file name is too long.
  95.     -$(do-install)
  96.  
  97. # Install the rpc data base file.
  98. $(sysconfdir)/rpc: etc.rpc
  99.     $(do-install)
  100.  
  101. defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"'
  102.  
  103. # Build the `rpcsvc' library of XDR functions.
  104.  
  105. lib: $(objpfx)librpcsvc.a
  106.  
  107. $(objpfx)librpcsvc.a: $(addprefix $(objpfx),$(rpcsvc-objs))
  108. # This library is small enough that it's simplest to recreate the archive
  109. # from scratch each time.
  110.     rm -f $@
  111. ifdef objdir
  112.     cd $(objdir); $(AR) cq$(verbose) $@ $(^:$(objpfx)%=%)
  113. else
  114.     $(AR) cq$(verbose) $@ $^
  115. endif
  116.     $(RANLIB) $@
  117.  
  118. # Generate the rpcsvc headers with rpcgen.
  119. $(objpfx)rpcsvc/%.h: rpcsvc/%.x $(objpfx)rpcgen
  120.     $(make-target-directory)
  121.     $(rpcgen-cmd) -h $< -o $@
  122. # Generate the rpcsvc XDR functions with rpcgen.
  123. $(objpfx)x%.c: rpcsvc/%.x $(objpfx)rpcgen
  124.     $(rpcgen-cmd) -c $< -o $@
  125. # The generated source files depend on the corresponding generated headers.
  126. # Gratuitous dependency on generated .c file here just gets it mentioned to
  127. # avoid being an intermediate file and getting removed.
  128. $(rpcsvc:%.x=$(objpfx)x%.o): $(objpfx)x%.o: $(objpfx)x%.c $(objpfx)rpcsvc/%.h
  129.